﻿//  -------------------- iSharePoint -------------------- //
// 
//  Company:	IT Complex, LLC
//  Project:	Smart.Common
//  File name:	TemplateCtx.cs
//  Developer:	Solomatov Igor
//  Created:	15.04.2012
// 
//  -------------------- iSharePoint -------------------- //

using System;
using System.Collections.Generic;

namespace Smart.Common.Templates
{
	/// <summary>
	/// Template context
	/// </summary>
	public class TemplateCtx
	{
		/// <summary>
		/// Template service name (Word, HTML and so on)
		/// </summary>
		public string ServiceName { get; set; }

		/// <summary>
		/// Template service
		/// </summary>
		public ITemplateService Service { get; set; }

		/// <summary>
		/// Template full path (url), including name (file name)
		/// </summary>
		public string TemplateId { get; set; }

		/// <summary>
		/// Template data (source)
		/// </summary>
		public ITemplate Template { get; set; }

		/// <summary>
		/// Instance (formatted template) name (file name).
		/// </summary>
		public string InstanceId { get; set; }

		/// <summary>
		/// Instance data (result)
		/// </summary>
		public ITemplateInstance Instance { get; set; }

		/// <summary>
		/// Values from template (predefined, loaded from template)
		/// </summary>
		public Dictionary<string, object> TemplateValues { get; set; }

		/// <summary>
		/// Document values (user defined values)
		/// </summary>
		public Dictionary<string, object> Values { get; set; }

		/// <summary>
		/// Template context base
		/// </summary>
		public TemplateCtx(string serviceName)
		{
			ServiceName = serviceName;

			TemplateValues = new Dictionary<string, object>(StringComparer.OrdinalIgnoreCase);
			Values = new Dictionary<string, object>(StringComparer.OrdinalIgnoreCase);
		}
	}
}